module AsciidocBib
  
  # Holds information about a citation in text:
  # the text forming the citation, its type, pretext, and enclosed cites.
  #
  # For example, the citation: "[cite:See:Lane12,59;Lane11]"
  # * original: "[cite:See:Lane12,59;Lane11]"
  # * type: "cite"
  # * pretext: "See"
  # * cites: [Citation{ref="Lane12",pages="59"}, Citation{ref="Lane11",pages=""} ]
  #
  class CitationData 
    # Original text defining this set of citations.
    attr_reader :original
    # The type of citation (e.g. 'cite', 'citenp').
    attr_reader :type
    # Any pretext given for the citation (e.g. 'See').
    attr_reader :pretext
    # List of Citation instances, defining each cite.
    attr_reader :cites 

    def initialize original, type, pretext, cites
      @original = original
      @type = type
      @pretext = if pretext.nil?
                   ''
                 else
                   pretext
                 end
      @cites = cites
    end
  end
end
